home *** CD-ROM | disk | FTP | other *** search
Text File | 1991-02-20 | 4.4 KB | 122 lines | [TEXT/MPS ] |
- CShell is broken up into a lot of files to (hopefully) make things easier for
- you to use. We have tried to arrange the source files in a way that you can
- start making it into you application right away. Of course, we realize that
- we can't think of everything here. (That's why you are there.) So if you
- have any suggestions to make CShell better, please don't be shy.
-
-
- Here's the organization of the source files:
-
- CSHELL C CODE: (Files you probably will need to change have are bulleted.)
-
- AppleEvents.c
- This file holds the core AppleEvents code. There is a very useful function
- in this file called MakeTarget (by Keith Rollin). This function creates
- a target descriptor for the AppleEvents, and it does it in a way that handles
- many of the variations, such as sending to yourself. If you are going to
- use AppleEvents, you will like MakeTarget.
-
- • AppleEvents2.c
- This is the application-specific AppleEvents code. The code for the custom
- AppleEvents is found here, as well as the code that targets a specific window,
- instead of a machine/application combination.
-
- • DoCursor.c
- This is the code for handling the cursor and for figuring out the cursor
- region for WaitNextEvent. Simply replace this code with your application's
- cursor code.
-
- • DoEvent.c
- This is the code that dispatches for the different events. Replace code
- as necessary for your application.
-
- EventLoop.c
- This code does next to nothing, and therefore most likely doesn't have to
- change, or doesn't need to change much.
-
- File.c
- This is a (kind-of) generic file I/O unit. The code in this file probably
- doesn't have to change. The functions that are application-specific are
- found in file2.c.
-
- • File2.c
- Here are the application-specific functions. You will need to change these
- functions from the CShell samples to be specific to your task.
-
- • Help.c
- This is the balloon help code. CShell supports dynamic balloon help in the
- content of the window. This file just holds some sample code for balloon
- help in the window content.
-
- • IdleTasks.c
- Handle any NULL event tasks that you application has. For CShell, this is
- when the balloon help code is called.
-
- Init.c
- This initialization code is separated from the rest of the application
- because it isn't supposed to have to change. (Yea, right.)
-
- • Menu.c
- Application-specific menu code goes here.
-
- Print.c
- This print-loop code shouldn't have to change. It sets up a global that
- the ImageDocument function can use to determine if it is printing or not.
- This global is the page number to be printed. (If it is 0, then the
- application isn't printing.) If the user wants all pages printed, the
- print-loop keeps sending ImageDocument incrementally larger page numbers
- to print. ImageDocument is responsible for figuring out that there are no
- more pages to print. When there are no more pages, just set gPrintPage
- to zero and return. The print-loop won't call ImageDocument after that.
- (This print-loop code is ZZ approved, and may end up in the print-loop
- tech-note.)
-
- Start.c
- This is the code that gets the application going. This is where you
- will find main().
-
- TextEditControl.c
- This is code for a TextEdit control. The control can easily be added to a
- window, just like any other control. The control handles clicks and key
- events. It also handles scrolling, cut/copy/paste/clear, as well as undo.
- (I think you will like this code.)
-
- Utils.c
- This is a catch-all for useful things I didn't know where else to put. You
- may like the code for key-equivalents for dialogs. The key-equivalents are
- put in the resource fork, so they can be localized.
-
- Window.c
- This is where all the generic window code lives.
-
- • Window2.c
- This is where all the application-specific window code lives. This is also
- where ImageDocument is located, which the print code calls.
-
-
- CSHELL ASSEMBLY CODE:
-
- There is a little bit of assembly code needed for CShell. Here are some
- descriptions of those files:
-
- TextEditControl.a
- This is the assembly code glue for the TextEdit control.
-
- View.cdef.a
- This is a little assembly code for a control definition. It is just a cdef
- stub that jumps to the application code. This is very useful for custom
- controls that need to call the rest of the application.
-
-
-
- A useful file to look at is CShell.protos. This is where all function
- prototypes can be found. They are grouped based on source file, so you
- can use CShell.protos as a table of content (of sorts) to find various
- functions.
-
-
-
- Happy Apps!
-
- Eric Soldan
-